#ifndef __TOPCVT_API_C_H__
#define __TOPCVT_API_C_H__

#include <stdint.h>

#ifdef WIN32
#	ifdef TOPCVT_EXPORTS
#		ifdef _WINDLL
#			define TOPCVT_C_API __declspec(dllexport)
#		else
#			define TOPCVT_C_API
#		endif
#	else
#		ifdef TOPCVT_IMPORT
#			define TOPCVT_C_API __declspec(dllimport)
#		else
#			define TOPCVT_C_API
#		endif
#	endif
#else
#	define TOPCVT_C_API
#endif

#ifndef mybool
#define mybool int 
#endif

#ifdef __cplusplus
extern "C" {
#endif

	struct PktContext;
	typedef struct PktContext PktContext_t;

	TOPCVT_C_API const char* getErrors();
	TOPCVT_C_API void clearErrors();
	TOPCVT_C_API void setPathOption(mybool pathType);
	TOPCVT_C_API void setDefaultEncoding(const char* encoding);
	TOPCVT_C_API PktContext_t* allocContext();
	TOPCVT_C_API void deallocContext(PktContext_t** pCtx);
	TOPCVT_C_API void setString(PktContext_t* ctx, const char* key, const char* value);
	TOPCVT_C_API void getString(PktContext_t* ctx, const char* key, char* value);
	TOPCVT_C_API void setObject(PktContext_t* ctx, const char* key, const PktContext_t* value);
	TOPCVT_C_API void getObject(PktContext_t* ctx, const char* key, PktContext_t* value);
	TOPCVT_C_API void getArray(PktContext_t* ctx, int arrayIndex, PktContext_t* value);
	TOPCVT_C_API void putArray(PktContext_t* ctx, PktContext_t* value);
	TOPCVT_C_API uint32_t getSize(PktContext_t* ctx);
	TOPCVT_C_API void clear(PktContext_t* ctx);

	TOPCVT_C_API const char* pack1(const char* pktPath, PktContext_t* ctx);
	TOPCVT_C_API const char* pack2(const char* pktPath, PktContext_t* ctx, const char* encoding);
	TOPCVT_C_API int unpack1(const char* pktPath, const char* str, PktContext_t* ctx);
	TOPCVT_C_API int unpack2(const char* pktPath, const char* str, PktContext_t* ctx, const char* encoding);

#ifdef __cplusplus
}
#endif


#endif //__TOPCVT_API_C_H__
